<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.CreateMateriaTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <h:panelGrid columns="2">
                    <h:outputLabel value="#{bundle.CreateMateriaLabel_idMateria}" for="idMateria" />
                    <h:inputText id="idMateria" value="#{materiaController.selected.idMateria}" title="#{bundle.CreateMateriaTitle_idMateria}" required="true" requiredMessage="#{bundle.CreateMateriaRequiredMessage_idMateria}"/>
                    <h:outputLabel value="#{bundle.CreateMateriaLabel_semestreIdeal}" for="semestreIdeal" />
                    <h:inputText id="semestreIdeal" value="#{materiaController.selected.semestreIdeal}" title="#{bundle.CreateMateriaTitle_semestreIdeal}" />
                    <h:outputLabel value="#{bundle.CreateMateriaLabel_nome}" for="nome" />
                    <h:inputText id="nome" value="#{materiaController.selected.nome}" title="#{bundle.CreateMateriaTitle_nome}" />
                    <h:outputLabel value="#{bundle.CreateMateriaLabel_codigo}" for="codigo" />
                    <h:inputText id="codigo" value="#{materiaController.selected.codigo}" title="#{bundle.CreateMateriaTitle_codigo}" />
                    <h:outputLabel value="#{bundle.CreateMateriaLabel_curso}" for="curso" />
                    <h:selectOneMenu id="curso" value="#{materiaController.selected.curso}" title="#{bundle.CreateMateriaTitle_curso}" required="true" requiredMessage="#{bundle.CreateMateriaRequiredMessage_curso}">
                        <f:selectItems value="#{cursoController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                </h:panelGrid>
                <br />
                <h:commandLink action="#{materiaController.create}" value="#{bundle.CreateMateriaSaveLink}" />
                <br />
                <br />
                <h:commandLink action="#{materiaController.prepareList}" value="#{bundle.CreateMateriaShowAllLink}" immediate="true"/>
                <br />
                <br />
                <h:link outcome="/index" value="#{bundle.CreateMateriaIndexLink}"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
